class Animal {
	private String name;

	public Animal(String name) {
		this.name = name;
	}

	public void makeSound() {
		System.out.println("The animal makes a sound.");
	}
}

class Dog extends Animal {
	public Dog(String name) {
		super(name);
	}

	@Override
	public void makeSound() {
		System.out.println("The dog barks.");
	}
}

class Cat extends Animal {
	public Cat(String name) {
		super(name);
	}

	@Override
	public void makeSound() {
		System.out.println("The cat meows.");
	}
}

public class Test {
	public static void main(String[] args) {
		Animal animal1 = new Dog("Buddy");
		Animal animal2 = new Cat("Whiskers");

		animal1.makeSound(); // Output: The dog barks.
		animal2.makeSound(); // Output: The cat meows.
	}
}
